Package com.netscape.cmscore.selftests
Class SelfTestSubsystem
java.lang.Object
com.netscape.certsrv.base.Subsystem
com.netscape.cmscore.selftests.SelfTestSubsystem
This class implements a container for self tests.
- Author:
- mharmsen, thomask
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deregisterSelfTestAtStartup
(String instanceName) Deregister an individual self test on the instances list AND on the "startup" list (note that the specified self test will be removed from each list).void
deregisterSelfTestOnDemand
(String instanceName) Deregister an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be removed from each list).void
disableSelfTestAtStartup
(String instanceName) Disable the specified self test at server startup.void
disableSelfTestOnDemand
(String instanceName) Disable the specified self test from being able to be executed on demand.void
enableSelfTestAtStartup
(String instanceName, boolean isCritical) Enable the specified self test at server startup.void
enableSelfTestOnDemand
(String instanceName, boolean isCritical) Enable the specified self test to be executed on demand.Returns the root configuration storage of this subsystem.getId()
This method retrieves the name of this subsystem.getSelfTest
(String instanceName) Retrieve an individual self test from the instances list given its instance name.Returns the LogEventListener of this subsystem.void
init
(ConfigStore config) This method initializes this subsystem.boolean
isSelfTestCriticalAtStartup
(String instanceName) Determine if failure of the specified self test is fatal to server startup.boolean
isSelfTestCriticalOnDemand
(String instanceName) Determine if failure of the specified self test is fatal when it is executed on demand.boolean
isSelfTestEnabledAtStartup
(String instanceName) Determine if the specified self test is executed automatically at server startup.boolean
isSelfTestEnabledOnDemand
(String instanceName) Determine if the specified self test is enabled to be executed on demand.String[]
List the instance names of all the self tests enabled to run at server startup (in execution order); may return null.String[]
List the instance names of all the self tests enabled to run on demand (in execution order); may return null.void
void
log
(LogEventListener logger, String msg) This method represents the log interface for the self test subsystem.void
registerSelfTestAtStartup
(String instanceName, boolean isCritical, SelfTest instance) Register an individual self test on the instances list AND on the "startup" list (note that the specified self test will be appended to the end of each list).void
registerSelfTestOnDemand
(String instanceName, boolean isCritical, SelfTest instance) Register an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be appended to the end of each list).void
runSelfTest
(String instanceName) Execute a self test.void
Execute all self tests specified to be run at server startup.void
Execute all self tests specified to be run on demand.void
This method sets information specific to this subsystem.void
shutdown()
Stops this subsystem.void
startup()
Notifies this subsystem if owner is in running mode.Methods inherited from class com.netscape.certsrv.base.Subsystem
getCMSEngine, setCMSEngine
-
Field Details
-
logger
public static org.slf4j.Logger logger -
ID
- See Also:
-
PROP_CONTAINER
- See Also:
-
PROP_INSTANCE
- See Also:
-
PROP_LOGGER
- See Also:
-
PROP_LOGGER_CLASS
- See Also:
-
PROP_ORDER
- See Also:
-
PROP_ON_DEMAND
- See Also:
-
PROP_STARTUP
- See Also:
-
mSelfTestInstances
-
mOnDemandOrder
-
mStartupOrder
-
-
Constructor Details
-
SelfTestSubsystem
public SelfTestSubsystem()
-
-
Method Details
-
getSelfTestNames
-
listSelfTestsEnabledOnDemand
List the instance names of all the self tests enabled to run on demand (in execution order); may return null.- Returns:
- list of self test instance names run on demand
-
enableSelfTestOnDemand
public void enableSelfTestOnDemand(String instanceName, boolean isCritical) throws EInvalidSelfTestException, EMissingSelfTestException Enable the specified self test to be executed on demand.- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)- Throws:
EInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
disableSelfTestOnDemand
Disable the specified self test from being able to be executed on demand.- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestEnabledOnDemand
Determine if the specified self test is enabled to be executed on demand.- Parameters:
instanceName
- instance name of self test- Returns:
- true if the specified self test is enabled on demand
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestCriticalOnDemand
Determine if failure of the specified self test is fatal when it is executed on demand.- Parameters:
instanceName
- instance name of self test- Returns:
- true if failure of the specified self test is fatal when it is executed on demand
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
runSelfTestsOnDemand
Execute all self tests specified to be run on demand.- Throws:
EMissingSelfTestException
- subsystem has missing nameESelfTestException
- self test exception
-
runSelfTest
Execute a self test.- Throws:
Exception
- self test exception
-
listSelfTestsEnabledAtStartup
List the instance names of all the self tests enabled to run at server startup (in execution order); may return null.- Returns:
- list of self test instance names run at server startup
-
enableSelfTestAtStartup
public void enableSelfTestAtStartup(String instanceName, boolean isCritical) throws EInvalidSelfTestException, EMissingSelfTestException Enable the specified self test at server startup.- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)- Throws:
EInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
disableSelfTestAtStartup
Disable the specified self test at server startup.- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestEnabledAtStartup
Determine if the specified self test is executed automatically at server startup.- Parameters:
instanceName
- instance name of self test- Returns:
- true if the specified self test is executed at server startup
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
isSelfTestCriticalAtStartup
Determine if failure of the specified self test is fatal to server startup.- Parameters:
instanceName
- instance name of self test- Returns:
- true if failure of the specified self test is fatal to server startup
- Throws:
EMissingSelfTestException
- subsystem has missing name
-
runSelfTestsAtStartup
Execute all self tests specified to be run at server startup.- signed.audit LOGGING_SIGNED_AUDIT_SELFTESTS_EXECUTION used when self tests are run at server startup
- Throws:
EMissingSelfTestException
- subsystem has missing nameException
- self test exception
-
log
-
getSelfTest
Retrieve an individual self test from the instances list given its instance name. This method may return null.- Parameters:
instanceName
- instance name of self test- Returns:
- individual self test
-
getSelfTestLogger
Returns the LogEventListener of this subsystem. This method may return null.- Returns:
- LogEventListener of this subsystem
-
log
This method represents the log interface for the self test subsystem.- Parameters:
logger
- log event listenermsg
- self test log message
-
registerSelfTestOnDemand
public void registerSelfTestOnDemand(String instanceName, boolean isCritical, SelfTest instance) throws EDuplicateSelfTestException, EInvalidSelfTestException, EMissingSelfTestException Register an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be appended to the end of each list).- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)instance
- individual self test- Throws:
EDuplicateSelfTestException
- subsystem has duplicate nameEInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
deregisterSelfTestOnDemand
Deregister an individual self test on the instances list AND on the "on demand" list (note that the specified self test will be removed from each list).- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
registerSelfTestAtStartup
public void registerSelfTestAtStartup(String instanceName, boolean isCritical, SelfTest instance) throws EDuplicateSelfTestException, EInvalidSelfTestException, EMissingSelfTestException Register an individual self test on the instances list AND on the "startup" list (note that the specified self test will be appended to the end of each list).- Parameters:
instanceName
- instance name of self testisCritical
- isCritical is either a critical failure (true) or a non-critical failure (false)instance
- individual self test- Throws:
EDuplicateSelfTestException
- subsystem has duplicate nameEInvalidSelfTestException
- subsystem has invalid name/valueEMissingSelfTestException
- subsystem has missing name/value
-
deregisterSelfTestAtStartup
Deregister an individual self test on the instances list AND on the "startup" list (note that the specified self test will be removed from each list).- Parameters:
instanceName
- instance name of self test- Throws:
EMissingSelfTestException
- subsystem has missing name
-
getId
This method retrieves the name of this subsystem. This method may return null. -
setId
This method sets information specific to this subsystem.- Overrides:
setId
in classSubsystem
- Parameters:
id
- identification of this subsystem- Throws:
EBaseException
- base CMS exception
-
init
This method initializes this subsystem. -
startup
Notifies this subsystem if owner is in running mode.- Overrides:
startup
in classSubsystem
- Throws:
EBaseException
- base CMS exception
-
shutdown
public void shutdown()Stops this subsystem. The owner may call shutdown anytime after initialization. -
getConfigStore
Returns the root configuration storage of this subsystem. This method may return null.- Overrides:
getConfigStore
in classSubsystem
- Returns:
- configuration store of this subsystem
-